import {request} from '../request/request'
//获取分类列表
export function getSortContent(){
  return new Promise((red, rej) => {
    request({
      url: '/shop/goods/category/all',
    }).then(res => {
      red(res)
    })
  })
}
//获取分类内容
export function getRightContent(){
  return new Promise((red, rej) => {
    request({
      // url:`/shop/goods/list?k=${this.data.inputValue}`,
      url:"/shop/goods/list",
      method:"POST"
    }).then(res => {
      red(res)
    })
  })
}
//获取详情
// /shop/goods/detail`
export function getDetail(id){
  return new Promise((red, rej) => {
    request({
      url:`/shop/goods/detail?id=${id}`,
      method:"GET",
      query:id
    }).then(res => {
      red(res)
    })
  })
}
//搜索
export function getSearch(value){
  return new Promise((red, rej) => {
    request({
      url:`/shop/goods/list?k=${value}`,
      method:"POST"
    }).then(res => {
      red(res)
    })
  })
}